package com.go.where.manager.action.go;

import javax.annotation.Resource;

import org.apache.log4j.Logger;

import com.go.where.manager.action.SuperAction;
import com.go.where.manager.common.Constants;
import com.go.where.manager.page.Pagination;
import com.go.where.manager.pojo.CustomerAddressInfo;
import com.go.where.manager.service.CustomerAddressService;
import com.go.where.manager.util.CommonUtil;
import com.google.gson.Gson;

public class CustomerAddressAction extends SuperAction {

	private static final long serialVersionUID = 1L;
	private static final Logger log = Logger
			.getLogger(CustomerAddressAction.class);
	@Resource(name = "customerAddressService")
	private CustomerAddressService customerAddressService;
	private CustomerAddressInfo customerAddressInfo;
	private CustomerAddressInfo customerAddressInfoQuery;
	private String customerId;
	public Pagination<?> page;

	Gson gson = CommonUtil.gson();

	/**
	 * 查询列表
	 * 
	 * @return
	 */
	public String list() {
		if (customerAddressInfoQuery == null) {
			customerAddressInfoQuery = new CustomerAddressInfo();
			customerAddressInfoQuery.setPageSize(Constants.INIT_PAGESIZE);
			customerAddressInfoQuery.setCurrentPage(Constants.INIT_CURRENTPAGE);
		}
		try {
			page = customerAddressService.queryPage(customerAddressInfoQuery);
		} catch (Exception e) {
			addActionError(e.getMessage());
			log.error("查询信息异常", e);
		}

		return LIST;
	}

	public CustomerAddressInfo getCustomerAddressInfo() {
		return customerAddressInfo;
	}

	public void setCustomerAddressInfo(CustomerAddressInfo customerAddressInfo) {
		this.customerAddressInfo = customerAddressInfo;
	}

	public CustomerAddressInfo getCustomerAddressInfoQuery() {
		return customerAddressInfoQuery;
	}

	public void setCustomerAddressInfoQuery(
			CustomerAddressInfo customerAddressInfoQuery) {
		this.customerAddressInfoQuery = customerAddressInfoQuery;
	}

	public String getCustomerId() {
		return customerId;
	}

	public void setCustomerId(String customerId) {
		this.customerId = customerId;
	}

	public Pagination<?> getPage() {
		return page;
	}

	public void setPage(Pagination<?> page) {
		this.page = page;
	}

}
